home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8818 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: rain.fr!world-net!usenet
  2. From: Frederic LACHASSE <lachass@worldnet.fr>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: [Help!] "Declaration syntax error" on interrupt program ?
  5. Date: Mon, 26 Feb 1996 20:16:18 +0000
  6. Organization: World-Net information exchange, Internet provider.
  7. Message-ID: <VA.0000004e.003df689@fred>
  8. References: <4gq1mk$8bl@jaring.my>
  9. Reply-To: lachass@worldnet.fr
  10. NNTP-Posting-Host: client35.sct.fr
  11. X-Newsreader: Virtual Access by Ashmount Research Ltd, http://www.ashmount.com
  12.  
  13. In article <4gq1mk$8bl@jaring.my>, yinchau@pl.jaring.my (Choong Yin 
  14. Chau) wrote:
  15. > Below is an example program from the Turbo C++ 3.0 Online Help.
  16. > However when I run the program, an error message appeared at line
  17. > "#####" stating that there is some "declaration syntax error" that I
  18. > failed to find out.
  19. > Can anyone help me with my first involvement in "interrupts".  TQ.
  20. > void interrupt (*mybeep)( void )
  21. > {                                                             #####
  22. >   int      i, j;
  23. [ rest of code snipped ]
  24.  
  25. interrupt is just a modifier like _cdecl and _pascal, so standard 
  26. declaration for functions must be used:
  27.  
  28. void interrupt mybeep(void)
  29. {
  30.   ...
  31. }
  32.  
  33. What you do is to define a pointer to an interrupt function that returns 
  34. void, then append a block of code. The compiler is right to complain.
  35.  
  36.  Frederic LACHASSE (ECP 86)
  37.  CompuServe: 100530,2005
  38.  Internet: lachass@worldnet.fr
  39.  
  40.